/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "pydgtbresponsa")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pydgtbresponsa.findAll", query = "SELECT p FROM Pydgtbresponsa p"),
    @NamedQuery(name = "Pydgtbresponsa.findByPydgtbresponsaid", query = "SELECT p FROM Pydgtbresponsa p WHERE p.pydgtbresponsaid = :pydgtbresponsaid")})
public class Pydgtbresponsa implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "pydgtbresponsaid")
    private Integer pydgtbresponsaid;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pydgtbresponsaid")
    private Collection<Sciftbactcont> sciftbactcontCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pydgtbresponsaid")
    private Collection<Sciftbinftecn> sciftbinftecnCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pydgtbresponsaid")
    private Collection<Sciftbinfdoc> sciftbinfdocCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pydgtbresponsaid")
    private Collection<Sciftbplandoc> sciftbplandocCollection;
    @JoinColumn(name = "scthtbdatosgenid", referencedColumnName = "scthtbdatosgenid")
    @ManyToOne(optional = false)
    private Scthtbdatosgen scthtbdatosgenid;
    @JoinColumn(name = "pydgtbrolid", referencedColumnName = "pydgtbrolid")
    @ManyToOne(optional = false)
    private Pydgtbrol pydgtbrolid;
    @JoinColumn(name = "pydgtbproyecid", referencedColumnName = "pydgtbproyecid")
    @ManyToOne(optional = false)
    private Pydgtbproyec pydgtbproyecid;

    public Pydgtbresponsa() {
    }

    public Pydgtbresponsa(Integer pydgtbresponsaid) {
        this.pydgtbresponsaid = pydgtbresponsaid;
    }

    public Integer getPydgtbresponsaid() {
        return pydgtbresponsaid;
    }

    public void setPydgtbresponsaid(Integer pydgtbresponsaid) {
        this.pydgtbresponsaid = pydgtbresponsaid;
    }

    @XmlTransient
    public Collection<Sciftbactcont> getSciftbactcontCollection() {
        return sciftbactcontCollection;
    }

    public void setSciftbactcontCollection(Collection<Sciftbactcont> sciftbactcontCollection) {
        this.sciftbactcontCollection = sciftbactcontCollection;
    }

    @XmlTransient
    public Collection<Sciftbinftecn> getSciftbinftecnCollection() {
        return sciftbinftecnCollection;
    }

    public void setSciftbinftecnCollection(Collection<Sciftbinftecn> sciftbinftecnCollection) {
        this.sciftbinftecnCollection = sciftbinftecnCollection;
    }

    @XmlTransient
    public Collection<Sciftbinfdoc> getSciftbinfdocCollection() {
        return sciftbinfdocCollection;
    }

    public void setSciftbinfdocCollection(Collection<Sciftbinfdoc> sciftbinfdocCollection) {
        this.sciftbinfdocCollection = sciftbinfdocCollection;
    }

    @XmlTransient
    public Collection<Sciftbplandoc> getSciftbplandocCollection() {
        return sciftbplandocCollection;
    }

    public void setSciftbplandocCollection(Collection<Sciftbplandoc> sciftbplandocCollection) {
        this.sciftbplandocCollection = sciftbplandocCollection;
    }

    public Scthtbdatosgen getScthtbdatosgenid() {
        return scthtbdatosgenid;
    }

    public void setScthtbdatosgenid(Scthtbdatosgen scthtbdatosgenid) {
        this.scthtbdatosgenid = scthtbdatosgenid;
    }

    public Pydgtbrol getPydgtbrolid() {
        return pydgtbrolid;
    }

    public void setPydgtbrolid(Pydgtbrol pydgtbrolid) {
        this.pydgtbrolid = pydgtbrolid;
    }

    public Pydgtbproyec getPydgtbproyecid() {
        return pydgtbproyecid;
    }

    public void setPydgtbproyecid(Pydgtbproyec pydgtbproyecid) {
        this.pydgtbproyecid = pydgtbproyecid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pydgtbresponsaid != null ? pydgtbresponsaid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pydgtbresponsa)) {
            return false;
        }
        Pydgtbresponsa other = (Pydgtbresponsa) object;
        if ((this.pydgtbresponsaid == null && other.pydgtbresponsaid != null) || (this.pydgtbresponsaid != null && !this.pydgtbresponsaid.equals(other.pydgtbresponsaid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Pydgtbresponsa[ pydgtbresponsaid=" + pydgtbresponsaid + " ]";
    }
    
}
